<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="demo">
			<p>{{fullName}}</p>
		</div>
		<script type="text/javascript">
			var vm = new Vue({
				el: "#demo",
				data: {
					firstName: "zhang",
					lastName: "san"
				},
				computed: {
					fullName: {
						get: function() {
							return this.firstName + " " + this.lastName;
						},
						set: function(value) {
							var arr=value.split(" ");
							this.firstName=arr[0];
							this.lastName=arr[1];
						}
					}
				}
			})
		</script>
	</body>
</html>
